Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix touch and wasm texture format error #20

Merged
merged 3 commits into from
Aug 3, 2023

Conversation

EmperialDev
Copy link
Contributor

@EmperialDev EmperialDev commented Jul 29, 2023

This may fix #15, I don't have the means to test on ios, but it works for the web and windows touchscreen device. It should also fix #9, with the workaround.

I implemented the fix for #9 by @nikolajevs86, so it now works on the web.

Then I added some missing scaling for the touch input, so now the touch input works as expected.

I also changed the order of mouse input and touch input, because I notice that when you use a windows touchscreen device, the touch would register at the mouse pos, if the mouse was inside the window.

@EmperialDev
Copy link
Contributor Author

Why is touch behind a feature? Both bevy and iced supports touch natively, so why souldn't this libary not also that? But I understand that it makes it more flexible, but then maybe just make touch a default feature, then people can turn it off, if they really don't want it.

@tasgon
Copy link
Owner

tasgon commented Jul 29, 2023

PR seems fine, but I'm too tired to review/merge it right now. I'll get back to you tomorrow afternoon.

Why is touch behind a feature?

Honestly, I hadn't looked into iced's touch support for a long time, so I wasn't sure how stable it was. I also don't have any (non-painful) way of testing the touch support, so I wanted it to be easy for users to completely disable it should problems arise. Now, I'm not sure if it's still worth feature-gating it, so I'll look into removing that.

@EmperialDev
Copy link
Contributor Author

If you use chrome devtools you can simulate touch on the web.

@tasgon
Copy link
Owner

tasgon commented Aug 3, 2023

This seems to work (but text rendering seems kinda screwy on wasm for me, could have something to do with iced-rs/iced#1900). Merging, thanks for the PR!

@tasgon tasgon changed the title Touch not working Fix touch and wasm texture format error Aug 3, 2023
@tasgon tasgon merged commit 4b56a0d into tasgon:master Aug 3, 2023
2 checks passed
@tasgon
Copy link
Owner

tasgon commented Aug 3, 2023

Release published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS touch support Wasm texture format issue
2 participants